﻿// --------------------------------------------------------------------------------------------------------------------
// <copyright file="TestTaskFactories.cs" company="JDML Consulting Ltd.">
//   Copyright 2011 Photon Project - http://photon.codeplex.com
// </copyright>
// <summary>
//   Defines the TestTaskFactories type.
// </summary>
// --------------------------------------------------------------------------------------------------------------------

namespace Photon.Threading
{
    internal static class TestTaskFactories
    {
        #region Fields

        private static TaskFactory _synchronous;

        #endregion

        public static TaskFactory Synchronous
        {
            get
            {
                if (_synchronous == null)
                {
                    _synchronous = new TaskFactory(new TaskScheduler(
                        new TaskDispatcher(Dispatcher.Synchronous, Dispatcher.Synchronous),
                        new TaskDispatcher(Dispatcher.Synchronous, Dispatcher.Synchronous)));
                }
                return _synchronous;
            }
        }
    }
}